Retrieve the Interior Color Index of a Cell using VBA in Microsoft Excel

Enter the following code into VBA.

Function InteriorColor(CellColor As Range)
Application.Volatile
InteriorColor = CellColor.Interior.ColorIndex
End Function

To use the this Custom Function type =InteriorColor(A1) into any cell.

Caution - This function does not update automatically when the interior color of a cell changes.

Return to Excel Exchange homepage.